<!DOCTYPE html>
<body>
  <div id="id" draggable="true"></div>
  <style>
    div {
      width: 100px;
      height: 100px;
      background-color: red;
    }
  </style>

  <script src="throttle.js"></script>
  <script>
    //id.ondrag = (e)=>console.log(e)
    id.ondrag = throttle((e) => console.log(e), 1000);
  </script>
</body>
